package com.xiangdao.service;

import com.xiangdao.dao.MessageDao;
import com.xiangdao.model.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class MessageService {
    @Autowired
    MessageDao messageDao;

    public int addMessage(Message message){
        return messageDao.addMessage(message);
    }

    public void deleteMessage(Integer id){
        messageDao.deleteMessage(id);
    }

    public ArrayList<Message> findAllMessage(){
        return messageDao.findAllMessage();
    }
}
